package cn.edu.ctbu.api01.domain;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/*
    针对tb_student的实体类
 */
@Data
@Entity(name="tb_student")
public class Student implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)  //自增方式
    private  Integer id;
    @NotNull
    @Size(min=10,max=10,message = "学号必须是10位")
    private String no;//学号
    @NotNull
    @Size(min=2,max=20)
    private String name;//姓名
    private String password;//密码
    private Integer sex;//性别，0未知，1男，2女
    @Min(16)
    @Max(30)
    private Integer age;//年龄
    @Min(0)
    @Max(100)
    private Integer score;//成绩
}